{include file="common/head"/}
<div class="layui-fluid"><div class="layui-card"><div class="layui-card-body">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>在线充值</legend>
    </fieldset>
    
    <form class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <label class="layui-form-label">会员ID</label>
                <div class="layui-input-inline">
                <input type="text" name="m_id" lay-verify="required" placeholder="请输入会员ID" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">充值金额</label>
                <div class="layui-input-inline">
                <input type="number" name="fee" lay-verify="required" placeholder="请输入充值金额" class="layui-input">
            </div>
        </div>
       
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="btn">立即提交</button>
                <a href="{:url('onlinepay')}" class="layui-btn layui-btn-primary">返回</a>
            </div>
        </div>
    </form>
</div>
</div>
</div>
{include file="common/foot"/}
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$= layui.jquery;
        form.on('submit(btn)', function (data) {
            // 提交到方法 默认为本身
            $.post("{:url('payadd')}",data.field,function(res){
                if(res.code > 0){
                    layer.msg(res.msg,{time:1000,icon:1},function(){
                        location.href = res.url;
                    });
                }else{
                    layer.msg(res.msg,{time:1000,icon:2});
                }
            });
        })
    });
</script>